#include<iostream>
#define MAX 20001

using namespace std;
int vector[MAX]={0};
int l, h, r;

int main() {
   int index = 0;
   while(cin >> l >> h >> r) {
      for(int i=l; i<r; i++) {
         if(h > vector[i]) 
            vector[i] = h;
      }
   }
   cout << 1 << " ";
   int current = vector[1];
   int i = 1;
   while(i<r) {
      cout << current << " ";
      while(current == vector[++i]);
      current = vector[i];
      cout << i << " "; 
   }
   cout << "0";
   return 0;
}
